package com.situ.water_system.service.impl;

import com.situ.water_system.mapper.SyAreaMapper;
import com.situ.water_system.pojo.SyArea;
import com.situ.water_system.pojo.SyDept;
import com.situ.water_system.mapper.SyDeptMapper;
import com.situ.water_system.service.SyDeptService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author Angel
 * @since 2020-12-01
 */
@Service
public class SyDeptServiceImpl extends ServiceImpl<SyDeptMapper, SyDept> implements SyDeptService {
    @Autowired
    private SyDeptMapper dao;
    public List<SyDept> selectList(){
        return  dao.selectList(null);
    }
    @Transactional
    public int del(Serializable id){
        return dao.deleteById(id);
    }
    @Transactional
    public int add(SyDept syArea){
        return dao.insert(syArea);
    }
    @Transactional
    public int update(SyDept syArea){
        return dao.updateById(syArea);
    }
    public SyDept selectByid(Serializable id){
        return  dao.selectById(id);
    }
    public List<Map> query_flow(){
        return dao.query_flow();
    }
    @Transactional
    public int update_flow(Map<String,String> ids){
                dao.update_flow(Integer.parseInt(ids.get("id")), Integer.parseInt(ids.get("deptid")));
return  1;
    }
}
